<?php (defined('BASEPATH')) OR exit('No direct script access allowed');

class Size_model  extends MY_Model  {

    public $table = 'size';

	public function __construct() {
		$this->class_name = get_class ( $this );
		parent::__construct( $this->class_name, $this->table );
		parent::init( $this->class_name, $this->table );
	}
	
    /**
     * Get row from DB given by sku
     *
     * @access public
     * @param string $sku
     * @param int $lang
     * @param int $imported
     * @return object
     */
    public function get_by_size($size) {
    	$where = 'size_uk = "' . $size . '"';

        $result =  $this->db->select()->from($this->table)->where($where)->get()->row();
        $obj = FALSE;
        if ($result) {
            $obj = $this->from_array((array)$result);
        }
        return $obj;
    }	
}